<!DOCTYPE html>
<html class="layui-bg-white">
<head th:include="include :: header"></head>
<body>
<div class="layui-form" style="padding:20px;">
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>账号：</label>
        <div class="layui-input-block">
            <input type="text" name="account" lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>姓名：</label>
        <div class="layui-input-block">
            <input type="text" name="username" lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>密码：</label>
        <div class="layui-input-block">
            <input type="password" name="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-row layui-form-item">
        <div class="layui-col-md6">
            <label class="layui-form-label"><span class="required">*</span>状态：</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-skin="switch" lay-filter="switchState" lay-text="正常|禁用" checked="checked">
                <input type="hidden" name="state" id="state" value="1">
            </div>
        </div>
        <div class="layui-col-md6">
            <label class="layui-form-label">性别：</label>
            <div class="layui-input-block">
                <input type="radio" name="gender" value="1" title="男" checked>
                <input type="radio" name="gender" value="2" title="女">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">生日：</label>
        <div class="layui-input-block">
            <input type="text" name="birthday" id="birthday" placeholder="请选择生日" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱：</label>
        <div class="layui-input-block">
            <input type="text" name="mailbox" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-row layui-form-item">
        <div class="layui-col-md4">
            <label class="layui-form-label">省份：</label>
            <div class="layui-input-block">
                <input type="text" name="province" placeholder="请输入省份" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md4">
            <label class="layui-form-label">城市：</label>
            <div class="layui-input-block">
                <input type="text" name="city" placeholder="请输入城市" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md4">
            <label class="layui-form-label">地区：</label>
            <div class="layui-input-block">
                <input type="text" name="district" placeholder="请输入地区" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详细地址：</label>
        <div class="layui-input-block">
            <input type="text" name="address" placeholder="请输入详细地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色：</label>
        <input type="hidden" name="ids" id="ids" autocomplete="off" class="layui-input">
        <div class="layui-input-block">
            <input type="checkbox" name="role" lay-skin="primary" th:each="item:${roles}" th:value="${item.id}" th:title="${item.name}">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-operate-submit" id="LAY-operate-submit" value="确认">
    </div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript">
    layui.config({
        base: ctx + '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index'         //主入口模块
    }).use(['index', 'form', 'laydate'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate;

        form.on('switch(switchState)', function (data) {
            if (data.elem.checked == true) {
                $('#state').val('1');
            } else {
                $('#state').val('0');
            }
        });

        form.verify(commonJs.form.verify);

        laydate.render({
            elem: '#birthday',
            trigger: 'click'
        });
    })
</script>
</body>
</html>

